package com.heima.apis.article;

import com.heima.apis.article.fallback.IArticleClientFallback;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.comment.dtos.CommentPageDto;
import com.heima.model.comment.dtos.StatusCommentDto;
import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.WmNewsStatisticsDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;

@FeignClient(value = "leadnews-article",fallback = IArticleClientFallback.class)
public interface IArticleClient {

    @PostMapping("/api/v1/article/save")
    public ResponseResult saveArticle(@RequestBody ArticleDto dto);

    @GetMapping("/api/v1/article/queryLikesAndConllections")
    public ResponseResult getNewsDimension(@RequestParam("wmUserId") Integer wmUserId, @RequestParam("beginDate") Date beginDate, @RequestParam("endDate") Date endDate);

    @PostMapping("/api/v1/article/newPage")
    public PageResponseResult getNewsPage(@RequestBody WmNewsStatisticsDto dto);

    @PostMapping("/api/v1/comment/manage/find_news_comments")
    public ResponseResult showListComment(@RequestBody CommentPageDto dto);


    @PostMapping("/api/v1/comment/manage/update_comment_status")
    public ResponseResult  updateStatusComment(@RequestBody StatusCommentDto dto);

    @GetMapping("/api/v1/comment/manage/get_is_comment")
    public Boolean getIsComment(@RequestParam("articleId") Long articleId);
}